//
//  LMapVC.m
//  黑马行
//
//  Created by L on 2017/5/10.
//  Copyright © 2017年 L. All rights reserved.
//

#import "LMapVC.h"
#import <MAMapKit/MAMapKit.h>

@interface LMapVC () <MAMapViewDelegate>

@end

@implementation LMapVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    MAMapView *mapView = [[MAMapView alloc] initWithFrame:self.view.bounds];
    
    [self.view addSubview:mapView];
    
    mapView.showsScale = YES;
    mapView.showTraffic = YES;
    mapView.delegate = self;
    
    mapView.userTrackingMode = MAUserTrackingModeFollowWithHeading;
}

/**
 * @brief 位置或者设备方向更新后，会调用此函数
 * @param mapView 地图View
 * @param userLocation 用户定位信息(包括位置与设备方向等数据)
 * @param updatingLocation 标示是否是location数据更新, YES:location数据更新 NO:heading数据更新
 */
- (void)mapView:(MAMapView *)mapView didUpdateUserLocation:(MAUserLocation *)userLocation updatingLocation:(BOOL)updatingLocation
{
    
}

/**
 * @brief 根据anntation生成对应的View
 * @param mapView 地图View
 * @param annotation 指定的标注
 * @return 生成的标注View
 */
- (MAAnnotationView *)mapView:(MAMapView *)mapView viewForAnnotation:(id <MAAnnotation>)annotation
{
    return nil;
}

@end
